package itheima;
public class Teacher {
    //私有成员变量;
    private String name;
    private int sid;
    public Teacher() {
    }
    //有参构造
    public Teacher(String name, int sid) {
        this.name = name;
        this.sid = sid;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getSid() {
        return sid;
    }
    public void setSid(int sid) {
        this.sid = sid;
    }
    //手动封装
    public void show() {
        System.out.println("工号为"+ sid + "的" + this.name + "老师正在上课");
    }
}
class TeacherTest {
    public static void main(String[] args) {
        Teacher s1 = new Teacher();
        s1.setName("张三");
        s1.setSid(9527);
        s1.show();
        Teacher s2 = new Teacher("张三", 9527);
        s2.show();
    }
}